{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'FileUtils'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-2-b57bfda5d9cf>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mFileUtils\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mfu\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[0mutils\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mfu\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mFileUtils\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m \u001b[0mread_lines\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mutils\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mreadLine\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mutils\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34mr'D:\\Users\\yincy\\Desktop\\brand\\storeidpoiid.txt'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'FileUtils'"
     ]
    }
   ],
   "source": [
    "import FileUtils as fu\n",
    "\n",
    "utils = fu.FileUtils\n",
    "\n",
    "read_lines = utils.readLine(utils, r'D:\\Users\\yincy\\Desktop\\brand\\storeidpoiid.txt')\n",
    "\n",
    "# lines = utils.readLine(utils, r'D:\\Users\\yincy\\Desktop\\brand\\poiid.txt')\n",
    "\n",
    "brandlines = utils.readLine(utils, r'D:\\Users\\yincy\\Desktop\\brand\\storeidbrandname.txt')\n",
    "\n",
    "dic = {}\n",
    "for read_line in read_lines:\n",
    "    split = read_line.split(\"\t\")\n",
    "    dic[split[0]] = split[1]\n",
    "\n",
    "# count = 0\n",
    "# exists = []\n",
    "# for line in lines:\n",
    "#     if line in dic:\n",
    "#         count = count + 1\n",
    "#         exists.append(line)\n",
    "#\n",
    "# #761585\n",
    "# print(\"查询到了\" + count)\n",
    "\n",
    "count = 0\n",
    "for brandline in brandlines:\n",
    "    brandline_split = brandline.split('\\t')\n",
    "    if brandline_split[0] in dic:\n",
    "        count = count + 1\n",
    "\n",
    "# print(\"查询到了\" + count)\n",
    "print(count)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
